package InheritanceDemo4;

public class CampusSystem {
    public static void main(String[] args) {
        // 创建不同类型的人员对象
        Person p1 = new Teacher("T001", "赵六", "男", 8000, 5);
        Person p2 = new Admin("A001", "孙七", "女", 6000, "学生处");

        // 父类数组管理
        Person[] persons = {p1, p2};

        // 遍历输出
        System.out.println("校园人员信息：");
        for (Person p : persons) {
            p.showBasicInfo();
            p.work();
            System.out.println("-----");
        }
    }
}